use core::ops::Deref;

use stm32f1::stm32f103::{self, dma1, gpioa, rcc, usart1};




pub mod uart;

pub struct RCC;

impl Deref for RCC {

    type Target = rcc::RegisterBlock;
    fn deref(&self) -> &Self::Target {
        unsafe { &*stm32f103::RCC::PTR }
    }
}

pub struct PA;

impl Deref for PA {
    type Target = gpioa::RegisterBlock;
    fn deref(&self) -> &Self::Target {
        unsafe { &*stm32f103::GPIOA::PTR }
    }
}

pub struct USART1;

impl Deref for USART1 {
    type Target = usart1::RegisterBlock;
    fn deref(&self) -> &Self::Target {
        unsafe { &*stm32f103::USART1::PTR }
    }
}

pub struct DMA1;

impl Deref for DMA1 {
    type Target = dma1::RegisterBlock;
    fn deref(&self) -> &Self::Target {
        unsafe { &*stm32f103::DMA1::PTR }
    }
}

